#include "laurin-80211-station.h"
#include "laurin-utils.h"



Laurin80211Station::Laurin80211Station(u_int8_t* mac)
{
	setMAC(mac);
}


Laurin80211Station::Laurin80211Station(const Laurin80211Station& station)
{
	if(station._mac)
		setMAC(station._mac);

	else if(_mac)
		free(_mac);

	_radioInfo = station._radioInfo;
}


Laurin80211Station::~Laurin80211Station()
{
	free(_mac);
}


struct laurin_packet_radio_info Laurin80211Station::getRadioInformations() const
{
	return _radioInfo;
}


void Laurin80211Station::setRadioInformations(const struct laurin_packet_radio_info& info)
{
	_radioInfo = info;
}


void Laurin80211Station::setMAC(u_int8_t* mac)
{
	if(!_mac)
		free(_mac);

	_mac = (u_int8_t*) malloc(ETH_ALEN);
	memcpy(_mac, mac, ETH_ALEN);
}


u_int8_t* Laurin80211Station::getMAC() const
{
	return _mac;
}



